    <link href="assets/css/flexslider.css" rel="stylesheet">
    <link href="assets/css/mainpage.css" rel="stylesheet">
    <script src="assets/js/jquery.flexslider-min.js"></script>
    <script src="assets/js/mainpage.js"></script>
    <?php
        $this->load->helper('photo');
        function gen_main_imgsrc($location) {
            return ($location == NULL) ? $location : photo_resize($location, 572, 429, true, 'height');
        }
        function gen_sub_imgsrc($location) {
            return ($location == NULL) ? $location : photo_resize($location, 143, 107, true, 'height');
        }
    ?>
    <div class="row">
        <div class="span9">
            <div class="border-wrap">
                <div class="border-inner slider-container">
                    <div class="flexslider slider-main">
                        <ul class="slides">
                        <?php
                        foreach($slides as $slide) {
                            echo '
                            <li>
                                <a href="' . post_link($slide['post_id']) . '">
                                    <img src="' . gen_main_imgsrc($slide['photo']['location']) . '" alt=' . $slide['slide_title'] . '>
                                    <div class="slider-caption-bg"></div>
                                    <div class="slider-caption">
                                        <p class="slider-caption-title">' . $slide['slide_title'] . '</p>
                                        <p class="slider-caption-content">' . $slide['slide_content'] . '</p>
                                    </div>
                                </a>
                            </li>
                            ';
                        }
                        ?>
                        </ul>
                    </div>
                    <div class="slider-sub">
                        <ul class="slides">
                        <?php
                        foreach($slides as $slide) {
                            echo '
                            <li>
                                <img src="' . gen_sub_imgsrc($slide['photo']['location']) . '"alt=' . $slide['slide_title'] . '>
                            </li>
                            ';
                        }
                        ?>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>